package com.woniuxy.hrms.service.impl;

import com.woniuxy.hrms.dao.IHrDao;
import com.woniuxy.hrms.dao.impl.IHrDaoImpl;
import com.woniuxy.hrms.entity.Hr;
import com.woniuxy.hrms.service.HrService;

import java.sql.SQLException;

/**
 * @program: hrms
 * @description:
 * @create: 2024-08-09 12:05
 **/
public class HrServiceImpl implements HrService {
    IHrDao hrDao=new IHrDaoImpl();
    @Override
    public boolean register(Hr hr) throws SQLException {
        int result=0;
        boolean b=hrDao.queryByUsername(hr.getUsername());
        if (!b) {
            result = hrDao.add(hr);
        }
        return result>0;
    }

    @Override
    public int add(Hr hr) {
        return 0;
    }
}
